Selective Inheritance and Overriding in Statically-Typed Object-Oriented Languages
نویسندگان
چکیده
We examine inheritance ill B~alically-lypedobjecl.-orienled languages. In some object-oriented languages it is possible to inherit selected methow from superdasse8. We call this selective inheritance. The obvious approach to selective inheritance in previous record-biLSed models of classes requires unnecessary ty pc reslricliollS. In this paper we propose 11. slightly different model whicll is more lenient in this regard. Furtllermore, our approach allows more classes to be typed in cases where methods are ovelIidden. We discuss modding objecl.-oriented languages and the implications of our proposed model. Categories iLIld Subject Descriptors: D.3.3 {Programming Languages]: La.nguage Constructs-data types and structures: F.3.3 [Logics and Meanings of Programs}: Studies of Program Constructstype structure General Terms: Lauguages. AdditionaJ I{eywords and Phrases: Objecl.-orienled languages, inheritance, records
منابع مشابه
Adding Traits to (Statically Typed) Languages
Traits offer a fine-grained mechanism for composing classes in object-oriented languages from reusable components, while avoiding the fragility problems introduced by multiple inheritance and mixins. Although traits were developed in the context of dynamically typed languages, they would also offer clear benefits for statically typed languages like Java and C#. This report summarizes the issues...
متن کاملInheritance-Based Subtyping
Classes play a dual rôle in mainstream statically-typed object-oriented languages, serving as both object generators and object types. In such languages, inheritance implies subtyping. In contrast, the theoretical language community has viewed this linkage as a mistake and has focused on subtyping relationships determined by the structure of object types, without regard to their underlying impl...
متن کاملSuperimposed Delegation
Object composition a well-known programming technique for supporting dynamic adaptation in statically typed class-based object-oriented programming languages suffers from two non-trivial problems; the common-self problem and the object reference update problem. Recently, it has been shown that the common-self problem can be solved for object composition in statically typed class-based languages...
متن کاملComparison of Object-Oriented Approaches for Roles in Programming Languages
This paper presents, explores and compares object-oriented approaches for roles in statically typed programming languages. We choose five solutions which support information hiding. On the one hand, we investigate the established object-oriented possibilities multiple and interface inheritance and the role object pattern, on the other hand, we examine the language extensions Object Teams and th...
متن کاملDynamic Inheritance and Static
In the area of object-orientation there is a long-standing schism between the rigid but safe statically typed languages, and the expressive and exible but less safe \typeless" languages. Many eeorts have aimed at combining the best of both. This paper presents a language mechanism which enhances the exibility and expressivity of static languages while preserving the safety properties. It is an ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013